{{#if complianceAvailabilityTask.isRunning}}
  {{pendulum-ellipsis-animation}}
{{else}}
  {{#if isCompliancePolicyAvailable}}

    <div id="compliance" class="tab-body">
      {{#if _hasBadData}}
        <div class="alert alert-danger post-action-notification" role="alert">
          <p>
            Oops! We have discovered some issues with this Dataset's fields that
            may put any updates in an invalid state. <br/>
            Unfortunately updates are <strong>disabled</strong> at this time. <br/>
            Please shoot us an email at
            <a href="mailto:ask_metadata@linkedin.com">ask_metadata@linkedin.com</a>
            and we will get on this asap! <br/>
            Our apologies.
          </p>
        </div>
      {{else}}
        <section class="action-bar">
          {{#if isEditing}}

            <div class="container action-bar__content">
              {{#if (has-next editStep editSteps)}}
                <button
                  class="nacho-button nacho-button--large-inverse action-bar__item"
                  title="Next"
                  {{action "nextStep"}}>
                  Next
                </button>
              {{else}}
                <button
                  class="nacho-button nacho-button--large-inverse action-bar__item"
                  title={{unless isDatasetFullyClassified
                                 "Ensure you have provided a yes/no value for all dataset tags"
                                 "Save"}}
                    disabled={{isSavingDisabled}}
                  {{action "saveCompliance"}}>
                  Save
                </button>
              {{/if}}

              {{#if (has-previous editStep editSteps)}}
                <button
                  class="nacho-button nacho-button--large nacho-button--secondary action-bar__item"
                  title="Back"
                  {{action "previousStep"}}>
                  Back
                </button>

              {{/if}}

              <button
                class="nacho-button nacho-button--large nacho-button--secondary action-bar__item"
                onclick={{action "onCancel"}}>
                Cancel
              </button>
            </div>

          {{/if}}
        </section>
      {{/if}}

      <div class="secondary-actions">
        {{#unless isEditing}}

          <button
            {{action "nextStep"}}
            class="nacho-button nacho-button--large secondary-actions__action">
            Edit
          </button>

          {{#unless isNewComplianceInfo}}
            <button
              {{action "onComplianceDownloadJson"}}
              class="nacho-button nacho-button--large nacho-button--secondary secondary-actions__action">
              Download compliance metadata
            </button>
          {{/unless}}

        {{/unless}}

        <div class="policy-last-saved">
          Last saved:
          {{#if isNewComplianceInfo}}
            <span class="policy-last-saved__saved">Never</span>
          {{else}}
            <span class="policy-last-saved__saved">
              {{moment-from-now complianceInfo.modifiedTime}}
            </span>
            by
            <span class="policy-last-saved__saved" title="{{complianceInfo.modifiedBy}}">
              {{tooltip-on-element text=complianceInfo.modifiedBy}}
              {{split-text complianceInfo.modifiedBy 30}}
            </span>
          {{/if}}
        </div>
      </div>

      {{#if isEditing}}
        <div class="dataset-compliance-step-container">
          {{partial "datasets/dataset-compliance/dataset-compliance-step-indicator"}}
        </div>
      {{/if}}

      {{#unless schemaless}}
        {{#if (and (eq editStep.name editSteps.0.name) (not _hasBadData))}}
          {{json-upload receiveJsonFile=(action "onComplianceJsonUpload") class="secondary-actions__action"}}
        {{/if}}
      {{/unless}}

      {{#if (or isReadOnly (eq editStep.name editSteps.2.name))}}
        {{partial "datasets/dataset-compliance/dataset-classification"}}
      {{/if}}

      {{#if (or isReadOnly (eq editStep.name editSteps.1.name))}}
        {{#if getPlatformPoliciesTask.isRunning}}
          {{pendulum-ellipsis-animation}}
        {{/if}}

        {{#if getPlatformPoliciesTask.last.isError}}
        {{!--todo: swap out with error-state component--}}
          {{empty-state
            heading="Purge Policies not available"
            subHead="Could not find supported purge policies for this platform"
          }}

          <div class="purge-policy-list__retry-platforms">
            <button
              class="nacho-button nacho-button--large-inverse"
              onclick={{perform getPlatformPoliciesTask}}>
              Retry
            </button>
          </div>

        {{/if}}

        {{#if getPlatformPoliciesTask.last.isSuccessful}}

          {{purge-policy
            isEditable=(not isReadOnly)
            platform=platform
            supportedPurgePolicies=supportedPurgePolicies
            purgeNote=complianceInfo.compliancePurgeNote
            purgePolicy=(readonly complianceInfo.complianceType)
            onPolicyChange=(action "onDatasetPurgePolicyChange")
          }}

        {{/if}}
      {{/if}}

      {{#if schemaless}}

        {{#if (or isReadOnly (eq editStep.name editSteps.0.name))}}
          {{datasets/schemaless-tagging
            isEditable=(not isReadOnly)
            containsPersonalData=(readonly complianceInfo.containingPersonalData)
            onPersonalDataChange=(action "onDatasetLevelPolicyChange")
          }}
        {{/if}}

      {{else}}

        {{#if (or isReadOnly (eq editStep.name editSteps.0.name))}}
          {{partial "datasets/dataset-compliance/dataset-compliance-entities"}}
        {{/if}}

      {{/if}}
    </div>

  {{else}}

    {{empty-state
      heading="Compliance Policy not available"
      subHead="Compliance Policy is currently not available for this platform"
    }}

  {{/if}}
{{/if}}
